package Management;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import Error.Errormanager;
import Management.fileIO.MyFileReader;

public class RuleList {
	private int			ruleNumber;
	private List<Rules>	list = new ArrayList<Rules>();
	
	/**
	 * 构造方法
	 */
	public RuleList() {
		try {
			ruleNumber = (new MyFileReader(Rules.directionary)).getline(Rules.directionary);
			int i;
			for (i = 1;i <= ruleNumber; i++) {
				Rules r = new Rules(i);
				list.add(i-1,r);
			}
		} catch (IOException e) {
			Errormanager error = new Errormanager();
			error.setNumber(Errormanager.FileNotFound);
			error.show();
		}
	}

	public int getRuleNumber() {
		return ruleNumber;
	}

	public void setRuleNumber(int ruleNumber) {
		this.ruleNumber = ruleNumber;
	}

	public List<Rules> getList() {
		return list;
	}

	public void setList(List<Rules> list) {
		this.list = list;
	}
	
}
